package cn.iocoder.yudao.module.system.dal.mysql.cylinderinfo;


import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.system.dal.dataobject.cylinderinfo.CylinderInfoDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.system.controller.admin.cylinderinfo.vo.*;

/**
 * 钢瓶信息 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface CylinderInfoMapper extends BaseMapperX<CylinderInfoDO> {

    default PageResult<CylinderInfoDO> selectPage(CylinderInfoPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CylinderInfoDO>()
                .eqIfPresent(CylinderInfoDO::getCode, reqVO.getCode())
                .eqIfPresent(CylinderInfoDO::getBarcode, reqVO.getBarcode())
                .eqIfPresent(CylinderInfoDO::getQrcode, reqVO.getQrcode())
                .eqIfPresent(CylinderInfoDO::getCylinderCode, reqVO.getCylinderCode())
                .eqIfPresent(CylinderInfoDO::getCoreCode, reqVO.getCoreCode())
                .eqIfPresent(CylinderInfoDO::getCoreType, reqVO.getCoreType())
                .eqIfPresent(CylinderInfoDO::getRegistrationCode, reqVO.getRegistrationCode())
                .eqIfPresent(CylinderInfoDO::getCreateStationId, reqVO.getCreateStationId())
                .betweenIfPresent(CylinderInfoDO::getLastCheckTime, reqVO.getLastCheckTime())
                .betweenIfPresent(CylinderInfoDO::getNextCheckTime, reqVO.getNextCheckTime())
                .eqIfPresent(CylinderInfoDO::getTypeId, reqVO.getTypeId())
                .betweenIfPresent(CylinderInfoDO::getUseTime, reqVO.getUseTime())
                .eqIfPresent(CylinderInfoDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(CylinderInfoDO::getExpecteInvalidTime, reqVO.getExpecteInvalidTime())
                .eqIfPresent(CylinderInfoDO::getFactoryCode, reqVO.getFactoryCode())
                .likeIfPresent(CylinderInfoDO::getFactoryName, reqVO.getFactoryName())
                .betweenIfPresent(CylinderInfoDO::getFactrueTime, reqVO.getFactrueTime())
                .betweenIfPresent(CylinderInfoDO::getFirstAerateTime, reqVO.getFirstAerateTime())
                .betweenIfPresent(CylinderInfoDO::getLastAerateTime, reqVO.getLastAerateTime())
                .eqIfPresent(CylinderInfoDO::getAerateCount, reqVO.getAerateCount())
                .eqIfPresent(CylinderInfoDO::getFillMediumCode, reqVO.getFillMediumCode())
                .eqIfPresent(CylinderInfoDO::getFillMedium, reqVO.getFillMedium())
                .eqIfPresent(CylinderInfoDO::getTare, reqVO.getTare())
                .eqIfPresent(CylinderInfoDO::getUseYear, reqVO.getUseYear())
                .eqIfPresent(CylinderInfoDO::getCheckCycle, reqVO.getCheckCycle())
                .eqIfPresent(CylinderInfoDO::getLastPosition, reqVO.getLastPosition())
                .eqIfPresent(CylinderInfoDO::getRecentCheckStationCode, reqVO.getRecentCheckStationCode())
                .likeIfPresent(CylinderInfoDO::getRecentCheckStationName, reqVO.getRecentCheckStationName())
                .eqIfPresent(CylinderInfoDO::getRecentCheckBatchCode, reqVO.getRecentCheckBatchCode())
                .eqIfPresent(CylinderInfoDO::getOwnerId, reqVO.getOwnerId())
                .eqIfPresent(CylinderInfoDO::getOwnerType, reqVO.getOwnerType())
                .eqIfPresent(CylinderInfoDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(CylinderInfoDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(CylinderInfoDO::getUpdater, reqVO.getUpdater())
                .orderByDesc(CylinderInfoDO::getId));
    }

}